home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / fido / RFS275.lha / rexx / RFSfreqlist.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-19  |  7KB  |  168 lines

  1. /**/
  2. v="$VER: RFSfreqList  Rexx WPL Freq List Creator Williamson 54.04"
  3. /*
  4.     Be sure to change the List command exclusion parameters (EXCLUDE)  
  5.     for those files you want ignored in listings
  6.  
  7.     Config File Format:
  8.     AREA# "PATH/" "NAME"
  9. */
  10. call Pragma("P",-1)
  11. sort=1
  12. /* LIST exclusion parameters    */
  13. EXCLUDE     =   '~(empty|area.text|files.bbs|LZTEMP.#?|.info)'
  14. /* WB2 List Lformat parameters  */
  15. LFFREQ      =   '"%N %F%N"'                       /* freq.lst         */
  16.  
  17. /*  You must create this file   */
  18. bbslist     = "CFG:BROWSE.CFG"                   /* filearea config  */
  19.  
  20. /* output files - edit names to suit */
  21. freqlist    = "MAIL:freq.lst"                  /* filename, full path */
  22.  
  23.  
  24. /* Configuration of Magic File Names for FREQ List              */
  25. /* A MAGIC NAME MAY POINT TO MORE THAN ONE FILE                 */
  26.  
  27. /* Standard MAGIC FileNames That Never Change                   */
  28. /* DO NOT change these entries, these are configured above      */
  29. magic.1 = "FILES    > Mail:FILELISTS/01670104.LHA"
  30. magic.2 = "NEWFILES > Mail:FILELISTS/NEWFILES.LST"
  31. magic.3 = "NEW      > Mail:FILELISTS/NEWFILES.LST"
  32.  
  33. /* add your FIXED MAGIC names here */
  34. magic.4 = "MAGIC    > CFG:ABOUT.TXT"
  35. magic.5 = "ABOUT    > CFG:ABOUT.TXT"
  36. magic.6 = "ROOFREXX > bbsf6:ROOF/ROOF_REXX.LHA"
  37. magic.7 = "ROOF     > BBSF6:ROOF/ROOF.LHA"
  38. magic.8 = "XPACK    > BBSF6:wpl/XPACK.LHA"
  39. magic.9 = "RFS      > BBSF6:WPL/RFS.LHA"
  40. magic.10 = "SHELTER  ^ BBSF6:WPL/SHELTER#?.LHA"
  41. magic.11 = "WFREQIT  > BBSF6:ROOF/WFREQIT.LHA"
  42.  
  43. /* FileNames that require updating to the latest version should */
  44. /* use '^' instead of '>'                                       */
  45. magic.12    = "FILEMGR      ^ BBSF6:ROOF/FILEMGR_V??.??.LHA"
  46. magic.13    = "POP          ^ BBSF6:WPL/POP#?.LHA"
  47. magic.14    = "JAZ          ^ BBSF6:WPL/JAZ#?.LHA"
  48. magic.15    = "RAP          ^ BBSF6:WPL/RAP#?.LHA"
  49. magic.16    = "SHE_UPD      ^ BBSF6:WPL/SHELTER??????.LHA"
  50. magic.17    = "XPA_UPD      ^ BBSF6:WPL/XPACK??????.LHA"
  51. magic.18    = "RFS_UPD      ^ BBSF6:WPL/RFS??????.LHA"
  52. magic.19    = "BBSLIST      ^ BBSF5:MTL-BBS/BBS?????.LST"
  53. magic.20    = "XQ_UPD       ^ BBSF6:WPL/XQUPD#?.LHA"
  54. magic.21    = "MELODY       ^ BBSF6:WPL/POP#?.#?"
  55. magic.22    = "MELODY       ^ BBSF6:WPL/JAZ#?.#?"
  56. magic.23    = "MELODY       ^ BBSF6:WPL/RAP#?.#?"
  57. magic.24    = "MELODY       > BBSF6:WPL/MELODY.DOC"
  58. magic.25    = "XPRZ3        ^ BBSF4:commlib/XPRZ3#?.lha"
  59. magic.26    = "WPLDEV       > BBSF6:WPL/WPL_DEV.LHA"
  60. magic.27    = "WXIDEV       > BBSF6:WPL/WXI_DEV.LHA"
  61. magic.28    = "FILESG       > MAIL:FILELISTS/AG167104.LHA"
  62. magic.29    = "NEWG         > MAIL:FILELISTS/newfiles.guide"
  63. magic.30    = "XQDEV        > BBSF6:wpl/XQ#?.LHA"
  64. magic.31    = "FTICK        > BBSF7:foz/FTICK97.LHA"
  65. magic.32    = "ALLFILES     > Mail:FILELISTS/01670104.LHA"
  66. magic.33    = "ALLFILES     > Mail:FILELISTS/AG167104.LHA"
  67. magic.34    = "ALLFILES     > MAIL:FILELISTS/newfiles.guide"
  68. magic.35    = "ALLFILES     > MAIL:FILELISTS/newfiles.lst"
  69. magic.36    = "FQ           > BBSF6:roof/FQ.lha"
  70. magic.37    = "FQUERY       > BBSF6:roof/FQ.lha"
  71. magic.38    = "MELODY       ^ BBSF6:WPL/ROCK#?.#?"
  72.  
  73. magics = 38
  74. /* NUMBER of MAGIC NAMES */
  75.  
  76. /* used internally */
  77. freqtemp = "T:FLST-"Pragma('ID')            /* temporary freq list */
  78.  
  79. script="RFSfreqList";ver="v"||right(v,5)
  80. lf='0a'x;CSI='9b'x;AOFF=CSI||'0m';BOLD=CSI||'1m';ULINE=CSI||'4m';ITALICS=CSI||'3;40m'
  81. quote='"';fmvers=BOLD||''script ver||AOFF
  82. options results
  83. options failat 20
  84. signal on halt
  85. signal on ioerr
  86. signal on break_c
  87. signal on break_d
  88.  
  89. call close('STDOUT');call open('STDOUT',"RAW:0/10/640/100/"script ver"/CLOSE",'w')
  90. call close('STDIN');call open('STDIN','*','R')
  91.  
  92. if ~open('dlst',bbslist, 'R') then do
  93.     call writeln(STDOUT, "Couldn't open fileareas list !")
  94.     exit 20
  95. end
  96. if show('p',"ROOFLOG") then address 'ROOFLOG' 'logline' left(time(),5) script': Updating Freq Listing'
  97. call writeln(STDOUT, lf||ITALICS||" "fmvers||lf||" by Robert Williamson 1:167/104.0@fidonet"||AOFF)
  98. /* Start Area Processing */
  99. call writeln(STDOUT, 'Reading file area configuration')
  100. area = 0
  101. do while ~eof('dlst')
  102.     call writech(STDOUT,'.')
  103.     blstln=readln('dlst')
  104.     if blstln="" then iterate
  105.     parse var blstln Number.area '"' Path.area '"' '"' Name.area '"'
  106.     if Path.area="NULL:" then iterate
  107.     area=area+1
  108. end /*eof*/
  109.  
  110. areas=area-1
  111. call writeln(STDOUT,lf||'Found 'areas' file areas')
  112.  
  113. call writeln(STDOUT, BOLD||"Generating File Request Listing"||AOFF||lf)
  114. call open('lstf',freqtemp,'W')      /* create the file */
  115. call close('lstf')                 /* delete old one  */
  116. if (magics ~= 0) then do
  117.     CR='0a'x
  118.     if ~open('tfl',freqtemp,'A') then do
  119.         call writeln(STDOUT, 'Unable to open 'freqtemp)
  120.         exit 10
  121.     end
  122.     call writeln(STDOUT, 'Updating 'magics' Magic names')
  123.     do i=1 to magics
  124.         call writech(STDOUT,'.')
  125.         /*                                                  file/magicname           !password                fullpath */
  126.         if left(word(magic.i,2),1) = '!' then writech('tfl',strip(word(magic.i,1))' 'strip(word(magic.i,2))' 'strip(word(magic.i,3))||CR)
  127.             else if word(magic.i,2) = '>' then writech('tfl',strip(word(magic.i,1))' 'strip(word(magic.i,3))||CR)
  128.         if word(magic.i,2) = '^' then do
  129.             close('tfl')
  130.             cmd='List >>'freqtemp word(magic.i,3) LFORMAT '"'word(magic.i,1)' %P%N"'
  131.             address COMMAND cmd
  132.             open('tfl',freqtemp,'A')
  133.         end
  134.     end
  135.     call close('tfl')
  136. end
  137.  
  138. call writeln(STDOUT, lf||'Processing')
  139. do area=0 to areas
  140.     call writeln(STDOUT,Path.area)
  141.     if Password.area = "PASSWORD."area | Password.area = "" then address COMMAND 'List >>"'freqtemp'"' Path.area||exclude 'FILES NOHEAD LFORMAT='LFFREQ
  142.     else address COMMAND 'List >>"'freqtemp'"' Path.area||exclude 'FILES NOHEAD LFORMAT="%N !'Password.area' %F%N"'
  143. end
  144.  
  145. if sort then do
  146.     call writeln(STDOUT, BOLD||'Sorting 'freqtemp' to 'freqlist||AOFF)
  147.     address COMMAND 'SORT' freqtemp freqlist
  148. end;else do
  149.     call writeln(STDOUT, BOLD||'Copying 'freqtemp' to 'freqlist||AOFF)
  150.     address COMMAND 'COPY' freqtemp freqlist
  151. end
  152. call delete(freqtemp)      
  153. if exists("RAM:FREQ.LST") then do
  154.     call writeln(STDOUT, BOLD||'Copying 'freqlist' to RAM:'||AOFF)
  155.     address COMMAND 'Copy' freqlist "RAM:FREQ.LST"
  156. end
  157. call writeln(STDOUT, 'Freq Listing completed')
  158. if show('p',"ROOFLOG") then address 'ROOFLOG' 'logline' left(time(),5) script': Freq Listing completed'
  159. exit
  160.  
  161. halt:
  162. ioerr:
  163. break_c:
  164. break_d:
  165.     call writech(STDOUT,lf)
  166.     exit 10
  167.  
  168.